import type { ApplicationInfo, ApplicationSaveOrUpdateParams } from '@/types'

const controller = getAjaxBaseUrl('/sysApplication')

/** 创建或更新应用资源 */
export function saveOrUpdate(params: Partial<ApplicationSaveOrUpdateParams>) {
  return post(`${controller}/saveOrUpdateApplication`, params)
}

/** 查询应用资源列表 */
export function queryList() {
  return get<ApplicationInfo[]>(`${controller}/queryApplicationList `)
}

/** 删除应用资源 */
export function deleteById(id: number) {
  return get(`${controller}/deleteApplication`, { id })
}
